<template>
  <div>
    <div class="bf">
      <span class="shang" @click="go">&lt;返回</span>
      <p>不凡</p>
    </div>

    <van-address-edit
      :area-list="areaList"
      show-postal
      show-delete
      show-set-default
      show-search-result
      :search-result="searchResult"
      :area-columns-placeholder="['请选择', '请选择', '请选择']"
      @save="onSave"
      @delete="onDelete"
      @change-detail="onChangeDetail"
    />
  </div>
</template>

<script>
import { no, orange } from "@/api/cart/index.js";
export default {
  data() {
    return {
      chosenAddressId: "1",
      list: [],
      areaList,
      searchResult: []
    };
  },

  computed: {},
  created() {
    orange({
      id: "45"
    }).then(res => {
      console.log(res);
    });
  },
  mounted() {},
  methods: {
    go() {
      this.$router.push({
        name: "cart1"
      });
    },
    time() {
      this.$router.push({
        name: "cart3"
      });
    },
    onSave() {
      Toast("save");
    },
    onDelete() {
      Toast("delete");
    },
    onChangeDetail(val) {
      if (val) {
        this.searchResult = [
          {
            name: "黄龙万科中心",
            address: "杭州市西湖区"
          }
        ];
      } else {
        this.searchResult = [];
      }
    }
  }
};
</script>

<style scoped lang="scss">
.bf p {
  font-size: 14px;
  color: brown;
}
a {
  text-decoration: none;
  color: brown;
  font-size: 14px;
  position: absolute;
  left: 20px;
  top: 20px;
}
.span {
  margin-left: 20px;
}
.shang {
  display: flex;
  flex-direction: column;
  position: absolute;
  top: 15px;
  left: 30px;
}
</style>